-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: plugin loading performance [patch/2.40.0] #2294
Merged
jenniferarnesen
merged 7 commits into
patch/2.40.0
from
fix/plugin-loading-performance-patch/2.40.0
May 3, 2023
Merged
fix: plugin loading performance [patch/2.40.0] #2294
jenniferarnesen
merged 7 commits into
patch/2.40.0
from
fix/plugin-loading-performance-patch/2.40.0
May 3, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…[DHIS2-15097] (#2285) * feat(iframe-plugin): receive pwa installation status from plugins * chore: add todos * fix: wait to render until the first item of the type has gotten the plugin * fix: add property to the top-most item of each iframe plugin type * fix: dont use the <Layer> component * chore: cli-app-scripts upgrade * fix: remove unused var * refactor: combine loops --------- Co-authored-by: Jen Jones Arnesen <jennifer@dhis2.org>
🚀 Deployed on https://pr-2294--dhis2-dashboard.netlify.app |
KaiVandivier
approved these changes
May 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the LL “version gate” and the “load first-of-type” features, and they seem to be working well 🙂 haven't tested the other things that were merged in though
edoardo
approved these changes
May 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements strategies to improve load time of the dashboard. The first time a dashboard is opened, only one plugin of each type (MAP, VISUALIZATION, LINE LIST) is loaded initially. Once those plugins report that they have loaded, then the other dashboard items proceed to load. This prevents multiple requests for the IFrame resources.
In order to cleanly apply these changes to the patch/2.40.0 branch, 2 backports had to be included:
Description
When using "View as" and switching between Map and chart/table or viceversa, the plugin loaded in the iframe needs to change.
This transition didn't work because the message listener in dashboard was not in place when the plugin requested getProps, resulting in the Map/chart/table not showing.
Switching between chart and table worked because in that case the plugin does not change and the newProps message is used instead of getProps.
The getProps listener is still removed in the cleanup function returned by the useEffect, but it's recreated if the iframe src change (plugin change).
After the first getProps message is received there shouldn't be other getProps messages incoming, but newProps is used for passing new/modified props instead.
About the changes in en.pot: The strings that appear to have been removed, were actually duplicated in the file, so this is a legit cleanup.